<!doctype html>
<html lang="en">
<head>
    <?php include './inc/css.html'; ?>

    <style type="text/css">
        html,body{
            height: 100%;
        }
        .ion-ios-more::before{display: none;}
        .wrap{
            margin:0 !important;
        }
        .row {
            margin-right: 0px;
            margin-left: 0px;
        }
        .form-horizontal .control-label {
            padding-top: 7px;
            margin-bottom: 0;
            text-align: right;
        }

        .form-horizontal .form-group input{
                border: none;
                outline: none;
                border-bottom: 1px solid #eee;
                border-radius: 0;
        }
        .form-horizontal label{
          font-size:80%;
        }

    </style>

</head>
<body class="_bg_light">


<!-- 页面头部 -->
<?php include './inc/pagetitle.html'; ?>


<div class="wrap">
    <div class="row">
          <div class="col-sm-6">
            <div class="logo _text_teriary" style="text-align: center;height:180px;line-height:180px;font-size:50px;color:#999;">
              2025HR
            </div>
          </div>
        <div class="col-sm-6">
            <form class="form-horizontal m-t" id="infoForm" novalidate="novalidate">


              <div class="form-group">
                <label for="schoolId" class="col-xs-3 control-label _text_secondary">学校:</label>
                <div class="col-xs-9">
                    <select class="form-control" id="schoolId" name="schoolId" value="">
                      <option value ="">请选择学校,注册后不可更改</option>
                    <?php for($i=1;$i<11;$i++){ ?>
                      <option value ="<?php echo $i; ?>"><?php echo '学校'.$i; ?></option>
                    <?php } ?>

                    </select>

                </div>
              </div>    

              <div class="form-group">
                <label for="nickname" class="col-xs-3 control-label _text_secondary">昵称:</label>
                <div class="col-xs-9">
                  <input type="input" id="nickname" name="nickname" class="form-control"  placeholder="填写昵称">
                </div>
              </div>    

              <div class="form-group">
                <label for="userName" class="col-xs-3 control-label _text_secondary">手机:</label>
                <div class="col-xs-9">
                  <input type="number" id="userName" name="userName" class="form-control"  placeholder="填写手机号">
                </div>
              </div>    
              <div class="form-group">
                <div class="col-xs-offset-3 col-xs-4">
                  <input type="number" id="yzcode" name="yzcode" class="form-control"  placeholder="验证码">
                </div>
                <div class="col-xs-4">
                  <button type="button" id="yzbtn" class="btn btn-block btn-default">验证码</button>
                </div>
              </div>
              <div class="form-group">
                <label for="password" class="col-xs-3 control-label _text_secondary">密码:</label>
                <div class="col-xs-9">
                  <input type="password" class="form-control" id="password" name="password" placeholder="填写密码">
                </div>
              </div>
              <div class="form-group">
                <label for="password" class="col-xs-3 control-label _text_secondary">确认密码:</label>
                <div class="col-xs-9">
                  <input type="password" class="form-control" id="confirmPwd" name="confirmPwd" placeholder="请确认密码">
                </div>
              </div>
              <div class="form-group">
                <div class="col-xs-offset-3 col-xs-4">
                  <button id="registerbtn" class="btn btn-block btn-success">注 册</button>
                </div>      
                <div class="col-xs-4">
                  <span id="gologin" class="btn btn-block btn-link gopage" data-url="./login.php">已有账号</span>
                </div>       
              </div>
            </form>
        </div>
    </div>
</div>

</body>
<?php include './inc/js.html'; ?>

<script type="text/javascript">

var time = 60;
$(function(){

  $('#yzbtn').on('click',function(){
        layer.msg('验证码已发送,请注意查收');
        var that = $(this);
        that.attr('disabled',true);

        var count = setInterval(function(){
          if(time<=0){
            that.attr('disabled',false).text('重新获取');
             clearInterval(count);
             return;
          }

          that.text('('+time+'s)');
          time--;
        },1000)
    })




    $('#registerbtn').on('click',function(e){

        e.preventDefault();
        var userName = $.trim($('input[name=userName]').val());
        var password = $.trim($('input[name=password]').val());
        var confirmPwd = $.trim($('input[name=confirmPwd]').val());
        var yzcode = $.trim($('input[name=yzcode]').val());
        var schoolId = $.trim($('#schoolId').val());


        if(userName.length==0||password.length==0||schoolId.length==0){
            layer.msg('请填写完整注册信息');
            return;
        }
        if(password!=confirmPwd){
            layer.msg('两次密码不一致');
            return;
        }
        if(yzcode.length==0){
            layer.msg('请填写验证码');
            return;
        }

        var data = {
            "schoolId":schoolId,
            "userName":userName,
            "password":$.md5(password),
            "confirmPwd":$.md5(confirmPwd),
            'yzcode':yzcode

        };


        // $.post('/index.php/WebApp/Users/toRegist',data ,function(result){
        //     var result = JSON.parse(result);
        //     if(!result.errcode){
        //         layer.msg(result.errmsg,{"time":1000});
        //     }else{
        //         layer.msg(result.errmsg,{"time":1000},function(){
        //           // 注册成功,跳转到登录页
        //           //window.location.href='';
        //         });
        //     }
        // })
        
        window.location.href='./profile.php';
               
    })




})
</script>

</html>